home *** CD-ROM | disk | FTP | other *** search
Wrap
//-------------------------------------------------------------- // // IChart.wfm - Inventory Chart for the Mugs Sample Application // // This form uses an ActiveX control to display a graph of // current inventory levels by supplier. This ActiveX is one // of three graphing ActiveX controls that come with Visual // dBASE. // // Refer to the Graph Help for detailed information on using // the ActiveX. This form defines all the constants associated // with this ActiveX. // // // Dependencies: INVENTORY.DMD // Pinnacle-BPS Graph Control (GRAPH32.OCX) // // Visual dBASE Samples Group // // $Revision: 1.9 $ // // Copyright (c) 1997, Borland International, Inc. // All rights reserved. // //--------------------------------------------------------------- // AutoInc Constants #define gphOff 0 /* Automatic incrementing off. */ #define gphOn 1 /* Automatic incrementing on. */ // DrawLineStyle and LegendStyle Constants #define gphMonochrome 0 /* Background white - all colors black. */ #define gphColor 1 /* Uses specified colors. */ // Graph type contstants #define gphNone 0 /* No graph. */ #define gphPie2d 1 /* Two-dimensional pie chart. */ #define gphPie3d 2 /* Three-dimensional pie chart. */ #define gphBar2d 3 /* Two-dimensional bar chart. */ #define gphBar3d 4 /* Three-dimensional bar chart. */ #define gphGantt 5 /* Gantt chart. */ #define gphLine 6 /* Line graph. */ #define gphLogLin 7 /* Log/Lin graph. */ #define gphArea 8 /* Area graph. */ #define gphScatter 9 /* Scatter graph. */ #define gphPolar 10 /* Polar graph. */ #define gphHLC 11 /* High-low-close graph. */ // BackgroundColor, ForegroundColor, and ColorData Constants #define gphBlack 0 /* Black. */ #define gphBlue 1 /* Blue. */ #define gphGreen 2 /* Green. */ #define gphCyan 3 /* Cyan. */ #define gphRed 4 /* Red. */ #define gphMagenta 5 /* Magenta. */ #define gphBrown 6 /* Brown. */ #define gphLightGray 7 /* Light gray. */ #define gphDarkGray 8 /* Dark gray. */ #define gphLightBlue 9 /* Light blue. */ #define gphLightGreen 10 /* Light green. */ #define gphLightCyan 11 /* Light cyan. */ #define gphLightRed 12 /* Light red. */ #define gphLightMagenta 13 /* Light magenta. */ #define gphYellow 14 /* Yellow. */ #define gphWhite 15 /* White. */ #define gphAutoBW 16 /* (Default) Auto black and white. */ // SymbolData Constants #define gphCrossPlus 0 /* Plus sign (+) symbol. */ #define gphCrossTimes 1 /* Multiplication sign (x) symbol.*/ #define gphTriangleUp 2 /* Upright triangle symbol. */ #define gphSolidTriangle 3 /* Solid triangle symbol. */ #define gphTriangleDown 4 /* Upside-down triangle symbol. */ #define gphSolidTriangleDown 5 /* Upside-down solid triangle symbol. */ #define gphSquare 6 /* Square symbol. */ #define gphSolidSquare 7 /* Solid square symbol. */ #define gphDiamond 8 /* Diamond symbol. */ #define gphSolidDiamond 9 /* Solid diamond symbol. */ // GridStyle Constants #define gphNone 0 /* No grid. */ #define gphHorizontal 1 /* Horizontal grid. */ #define gphVertical 2 /* Vertical grid. */ #define gphBoth 3 /* Both grids. */ // DataReset Constants #define gphNone 0 /* No reset. */ #define gphGraphData 1 /* Resets graph data. */ #define gphColorColorData 2 /* Resets color data. */ #define gphExtraData 3 /* Resets extra data. */ #define gphLabelText 4 /* Resets label text. */ #define gphLegendText 5 /* Resets legend text. */ #define gphPatternData 6 /* Resets pattern data. */ #define gphSymbolData 7 /* Resets symbol data. */ #define gphXPosData 8 /* Resets x-position data. */ #define gphAllData 9 /* Resets all data. */ #define gphFontInfo 10 /* Resets font information. */ // DrawMode Constants #define gphNoAction 0 /* No graph drawn at design time. */ #define gphClear 1 /* Display properties without graph */ #define gphDraw 2 /* Always displays graph. */ #define gphBlit 3 /* Use blitting technique. */ #define gphCopy 4 /* Copies graph to Clipboard. */ #define gphPrint 5 /* Sends graph to printer. */ #define gphWrite 6 /* Writes graph to disk. */ // FontStyle Constants #define gphDefault 0 /* Default. */ #define gphItalic 1 /* Italic. */ #define gphBold 2 /* Bold. */ #define gphBoldItalic 3 /* BoldItalic. */ #define gphUnderlined 4 /* Underlined. */ #define gphUnderlinedItalic 5 /* UnderlinedItalic. */ #define gphUnderlinedBold 6 /* UnderlinedBold. */ #define gphUnderlinedBoldItalic 7 /* UnderlinedBoldItalic. */ // FontFamily Constants #define gphRoman 0 /* Roman. */ #define gphSwiss 1 /* Swiss. */ #define gphModern 2 /* Modern. */ // FontUse Constants #define gphGraphTitle 0 /* GraphTitle. */ #define gphOtherTitles 1 /* OtherTitles. */ #define gphLabels 2 /* Labels. */ #define gphLegend 3 /* Legend. */ #define gphAllText 4 /* AllText. */ // IndexStyle Constants #define gphStandard 0 /* Standard. */ #define gphEnhanced 1 /* Enhanced. */ // Labels Constants #define gphOff 0 /* Off. */ #define gphOn 1 /* On. */ #define gphXAxisLabelsOnly 2 /* X-axis labels only. */ #define gphYAxisLabelsOnly 3 /* Y-axis labels only. */ // LineStats Constants #define gphNone 0 /* None. */ #define gphMean 1 /* Mean. */ #define gphMinmax 2 /* MinMax. */ #define gphMeanMinmax 3 /* Mean and MinMax. */ #define gphStddev 4 /* Stddev. */ #define gphStddevMean 5 /* StdDev and Mean. */ #define gphStddevMinmax 6 /* StdDev and MinMax. */ #define gphStddevMinmaxMean 7 /* StdDev and MinMax and Mean. */ #define gphBestfit 8 /* BestFit. */ #define gphBestfitMean 9 /* BestFit and Mean. */ #define gphBestfitMinmax 10 /* BestFit and MinMax. */ #define gphBestfitMinmaxMean 11 /* BestFit and MinMax and Mean. */ #define gphBestfitStddev 12 /* BestFit and StdDev. */ #define gphBestfitStddevMean 13 /* BestFit and StdDev and Mean. */ #define gphBestfitStddevMinmax 14 /* BestFit and StdDev and MinMax. */ #define gphAll 15 /* All. */ // Palette Constants #define gphDefault 0 /* Default. */ #define gphPastel 1 /* Pastel. */ #define gphGrayscale 2 /* Grayscale. */ // PatternedLines Constants #define gphPatternOff 0 /* Pattern off. */ #define gphPatternOn 1 /* Pattern on. */ // PrintStyle Constants #define gphMonochrome 0 /* Color. */ #define gphColor 1 /* Color with border. */ #define gphMonochromeWithBorder 2 /* Monochrome. */ #define gphColorWithBorder 3 /* Monochrome with border. */ // RandomData Constants #define gphOff 0 /* Off. */ #define gphOn 1 /* On. */ // ThickLines Constants #define gphLinesOff 0 /* Lines off. */ #define gphLinesOn 1 /* Lines on. */ // YAxisPos Constants #define gphDefault 0 /* Default. */ #define gphAlignLeft 1 /* Align left. */ #define gphAlignRight 2 /* Align right. */ // YAxisStyle Constants #define gphDefault 0 /* Default. */ #define gphVariableOrigin 1 /* Variable origin. */ #define gphUserDefined 2 /* User-defined. */ // Ticks Constants #define gphTicksOff 0 /* Ticks off. */ #define gphTicksOn 1 /* Ticks on. */ #define gphXAxisTicksOnly 2 /* X-axis ticks only. */ #define gphYAxisTicksOnly 3 /* Y-axis ticks only. */ SET TALK OFF ** END HEADER -- do not remove this line // // Generated on 10/23/97 // parameter bModal local f f = new ichartForm() if (bModal) f.mdi = false // ensure not MDI f.readModal() else f.open() endif class ichartForm of FORM set procedure to MUGS.CC additive with (this) open = class::FORM_OPEN readModal = class::FORM_READMODAL scaleFontSize = 8 scaleFontBold = false height = 16.7273 left = 3 top = 0.5789 width = 69.1429 text = "Inventory Chart" endwith this.DMINVENTORY = new DATAMODREF() this.DMINVENTORY.parent = this with (this.DMINVENTORY) filename = "inventory.dmd" dataModClass = "InventoryDataModule" share = 0 active = true left = 0 top = 0 endwith this.CHARTBOX = new RECTANGLE(this) with (this.CHARTBOX) left = 2 top = 0.9545 width = 66 height = 11.8421 metric = 0 text = "" colorNormal = "WindowText/BtnFace" fontName = "MS Sans Serif" fontSize = 8 pageno = 0 endwith this.RECTANGLE1 = new RECTANGLE(this) with (this.RECTANGLE1) left = 2 top = 13.2727 width = 48 height = 2.8421 metric = 0 text = "Supplier" colorNormal = "WindowText/BtnFace" fontName = "MS Sans Serif" fontSize = 8 endwith this.CHART = new ACTIVEX(this) with (this.CHART) height = 10.8947 left = 3 top = 1.4211 width = 64 metric = 0 license = "" state = "BBBBBCBBMHDFBBBBJECEBBBBHBBBBBBBBCBBBCHFBBBCBBBQBBBBBDBBBCBBCBBBBBBBBBBBBEBBBBBBBBBBBBBCBBBCBBBBBBBBBBBBBGBBBCBBBBBBBBBBBBBBBCBBBCBBBCBBBCBBBBBBBBBBBBBBBBBBBBBBBBBBBCBBBBBBBBBBBBBBBFBBBBBBBBBBBBBBBBBBBFBBNJBBKHBBHFBBHFBBBFBBBBBBBBBBBBBBBBBBBCBBBBBBBBBBBBBB"; + "BBBBBBBBBBBBBBBB" classId = "{0842D100-1E19-101B-9AAF-1A1626551E7C}" endwith this.COMBOSUPPLIER = new COMBOSUPPLIER(this) with (this.COMBOSUPPLIER) onChange = class::REFRESHCHART onOpen = class::COMBOSUPPLIER_ONOPEN height = 1.1053 left = 3 top = 14.2105 width = 44 metric = 0 fontName = "MS Sans Serif" fontSize = 8 endwith this.BUTTONOK = new PUSHBUTTON(this) with (this.BUTTONOK) onClick = class::BUTTONOK_ONCLICK height = 1.2105 left = 53 top = 14.2105 width = 12 text = "OK" metric = 0 fontName = "MS Sans Serif" fontSize = 8 group = true colorNormal = "BtnText/BtnFace" pageno = 0 value = false endwith this.ERRORMSG = new TEXT(this) with (this.ERRORMSG) height = 9 left = 5 top = 2.3684 width = 59 metric = 0 colorNormal = "darkred/darkred" fontBold = true text = "Graphics Server not found. To view the chart, exit Visual dBASE and install the sample ActiveX controls for Visual dBASE. If the ActiveX controls are already present, check the windows system folder for GRAPH32.OCX and register the ActiveX with REGSVR32." pageno = 2 endwith this.rowset = this.DMINVENTORY.ref.supplier1.rowset // {Linked Method} form.combosupplier.onOpen function comboSupplier_onOpen COMBOSUPPLIER::COMBOSUPPLIER_OnOpen() class::refreshChart() this.form.pageno := 1 return true // {Linked Method} form.buttonok.onClick function buttonok_onClick this.form.comboSupplier.onChange := null return ( this.form.close() ) // {Linked Method} form.combosupplier.onChange function refreshChart local i, rInvent i = 1 rInvent = this.form.dmInventory.ref.inventory1.rowset rSupplier = this.form.dmInventory.ref.supplier1.rowset rSupplier.applyLocate( "COMPANY = '" + this.value + "'" ) rInvent.filter := '"Supplier ID" = ' + ; rSupplier.fields["Supplier ID"].value with ( this.form.chart.nativeObject ) resetData := gphGraphData resetData := gphLabelText numPoints := rInvent.count() graphTitle := "Inventory from " + ; rSupplier.fields["Company"].value rInvent.first() do while ( not rInvent.endOfSet ) thisPoint := i graphData := rInvent.fields["Qty"].value thisPoint := i labelText := rInvent.fields["Description"].value i++ rInvent.next() enddo drawmode := gphBlit endwith return true // {Linked Method} form.open function Form_open return ( class::Form_readModal() ) // {Linked Method} form.readModal function Form_readModal local bChartFound bChartFound = ( TYPE("this.chart.nativeObject.numPoints") == "N" ) if ( bChartFound ) with ( this.chart.nativeObject ) graphType := gphBar3d background := gphLightGray endwith this.comboSupplier.value := ; this.dmInventory.ref.supplier1.rowset.fields["COMPANY"].value this.pageno := 3 // start with blank page else with ( this ) comboSupplier.onOpen := null pageno := 2 // error page endwith endif this.mdi := false return ICHARTFORM::READMODAL() endclass